9902dfb6475ce51f8d7e516025d3cb2e7f16a853,noisemap-core/src/main/java/org/orbisgis/noisemap/core/FastObstructionTest.java,FastObstructionTest,getNextTri,#number#LineSegment#HashSet#,157
Before Change
//add: search triangle without height
if (idneigh != -1 && !navigationHistory.contains(idneigh)) {
distline_line = propagationLine.distance(new LineSegment(aTri, bTri));
if (distline_line < FastObstructionTest.epsilon &&
distline_line < nearestIntersectionPtDist) {
nearestIntersectionPtDist = distline_line;
nearestIntersectionSide = 2;
//we will get the intersection point coordinate with(x,y,NaN)
if (!(propagationLine.intersection(new LineSegment(aTri, bTri)) == null)) {
intersection = new Coordinate(propagationLine.intersection(new LineSegment(aTri, bTri)));
//get this point Z using interested segment.
zTopoIntersection = calculateLinearInterpolation(aTri, bTri, intersection);
}
}
}
// Intersection Second Side
idneigh = triNeighbors.get(0);
if (idneigh != -1 && !navigationHistory.contains(idneigh)) {
distline_line = propagationLine.distance(new LineSegment(bTri, cTri));
if (distline_line < FastObstructionTest.epsilon &&
distline_line < nearestIntersectionPtDist) {
nearestIntersectionPtDist = distline_line;
nearestIntersectionSide = 0;
if (!(propagationLine.intersection(new LineSegment(bTri, cTri)) == null)) {
intersection = new Coordinate(propagationLine.intersection(new LineSegment(bTri, cTri)));
//get this point Z using interested segment.
zTopoIntersection = calculateLinearInterpolation(bTri, cTri, intersection);
}
}
}
// Intersection Third Side
idneigh = triNeighbors.get(1);
if (idneigh != -1 && !navigationHistory.contains(idneigh)) {
distline_line = propagationLine.distance(new LineSegment(cTri, aTri));
if (distline_line < FastObstructionTest.epsilon &&
distline_line < nearestIntersectionPtDist) {
nearestIntersectionSide = 1;
if (!(propagationLine.intersection(new LineSegment(cTri, aTri)) == null)) {
After Change
// Intersection Second Side
idneigh = triNeighbors.get(0);
if (idneigh != -1 && !navigationHistory.contains(idneigh)) {
Coordinate intersectionTest = propagationLine.intersection(new LineSegment(bTri, cTri));
if(intersectionTest != null) {
distline_line = propagationLine.p1.distance(intersectionTest);
if (distline_line < nearestIntersectionPtDist) {
intersection = intersectionTest;
nearestIntersectionPtDist = distline_line;
nearestIntersectionSide = 0;